{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Have several agents collaborate in a multi-agent hierarchy 🤖🤝🤖\n",
    "_Authored by: [Aymeric Roucher](https://huggingface.co/m-ric)_\n",
    "\n",
    "> This tutorial is advanced. You should have notions from [this other cookbook](agents) first!\n",
    "\n",
    "In this notebook we will make a **multi-agent web browser: an agentic system with several agents collaborating to solve problems using the web!**\n",
    "\n",
    "It will be a simple hierarchy, using a `ManagedAgent` object to wrap the managed web search agent:\n",
    "\n",
    "```\n",
    "              +----------------+\n",
    "              | Manager agent  |\n",
    "              +----------------+\n",
    "                       |\n",
    "        _______________|______________\n",
    "       |                              |\n",
    "  Code interpreter   +--------------------------------+\n",
    "       tool          |         Managed agent          |\n",
    "                     |      +------------------+      |\n",
    "                     |      | Web Search agent |      |\n",
    "                     |      +------------------+      |\n",
    "                     |         |            |         |\n",
    "                     |  Web Search tool     |         |\n",
    "                     |             Visit webpage tool |\n",
    "                     +--------------------------------+\n",
    "```\n",
    "Let's set up this system. \n",
    "\n",
    "Run the line below to install the required dependencies:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install markdownify duckduckgo-search smolagents --upgrade -q"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's login in order to call the HF Inference API:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from huggingface_hub import notebook_login\n",
    "\n",
    "notebook_login()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "⚡️ Our agent will be powered by [Qwen/Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct) using `HfApiEngine` class that uses HF's Inference API: the Inference API allows to quickly and easily run any OS model.\n",
    "\n",
    "_Note:_ The Inference API hosts models based on various criteria, and deployed models may be updated or replaced without prior notice. Learn more about it [here](https://huggingface.co/docs/api-inference/supported-models)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "model_id = \"Qwen/Qwen2.5-72B-Instruct\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 🔍 Create a web search tool\n",
    "\n",
    "For web browsing, we can already use our pre-existing [`DuckDuckGoSearchTool`](https://github.com/huggingface/transformers/blob/main/src/transformers/agents/search.py) tool to provide a Google search equivalent.\n",
    "\n",
    "But then we will also need to be able to peak into the page found by the `DuckDuckGoSearchTool`.\n",
    "To do so, we could import the library's built-in `VisitWebpageTool`, but we will build it again to see how it's done.\n",
    "\n",
    "So let's create our `VisitWebpageTool` tool from scratch using `markdownify`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "import re\n",
    "import requests\n",
    "from markdownify import markdownify as md\n",
    "from requests.exceptions import RequestException\n",
    "from smolagents import tool\n",
    "\n",
    "\n",
    "@tool\n",
    "def visit_webpage(url: str) -> str:\n",
    "    \"\"\"Visits a webpage at the given URL and returns its content as a markdown string.\n",
    "\n",
    "    Args:\n",
    "        url: The URL of the webpage to visit.\n",
    "\n",
    "    Returns:\n",
    "        The content of the webpage converted to Markdown, or an error message if the request fails.\n",
    "    \"\"\"\n",
    "    try:\n",
    "        # Send a GET request to the URL\n",
    "        response = requests.get(url)\n",
    "        response.raise_for_status()  # Raise an exception for bad status codes\n",
    "\n",
    "        # Convert the HTML content to Markdown\n",
    "        markdown_content = md(response.text).strip()\n",
    "\n",
    "        # Remove multiple line breaks\n",
    "        markdown_content = re.sub(r\"\\n{3,}\", \"\\n\\n\", markdown_content)\n",
    "\n",
    "        return markdown_content\n",
    "\n",
    "    except RequestException as e:\n",
    "        return f\"Error fetching the webpage: {str(e)}\"\n",
    "    except Exception as e:\n",
    "        return f\"An unexpected error occurred: {str(e)}\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ok, now let's initialize and test our tool!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hugging Face - Wikipedia\n",
      "\n",
      "[Jump to content](#bodyContent)\n",
      "\n",
      "Main menu\n",
      "\n",
      "Main menu\n",
      "move to sidebar\n",
      "hide\n",
      "\n",
      "Navigation\n",
      "\n",
      "* [Main page](/wiki/Main_Page \"Visit the main page [z]\")\n",
      "* [Contents](/wiki/Wikipedia:Contents \"Guides to browsing Wikipedia\")\n",
      "* [Current events](/wiki/Portal:Current_events \"Articles related to current events\")\n",
      "* [Random article](/wiki/Special:Random \"Visit a randomly selected article [x]\")\n",
      "* [About Wikipedia](/wiki/Wikipedia:About \"Learn about Wikipedia and how it works\")\n",
      "* [Contac\n"
     ]
    }
   ],
   "source": [
    "print(visit_webpage(\"https://en.wikipedia.org/wiki/Hugging_Face\")[:500])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Build our multi-agent system 🤖🤝🤖\n",
    "\n",
    "Now that we have all the tools `search` and `visit_webpage`, we can use them to create the web agent.\n",
    "\n",
    "Which configuration to choose for this agent?\n",
    "- Web browsing is a single-timeline task that does not require parallel tool calls, so JSON tool calling works well for that. We thus choose a `ReactJsonAgent`.\n",
    "- Also, since sometimes web search requires exploring many pages before finding the correct answer, we prefer to increase the number of `max_iterations` to 10."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from smolagents import (\n",
    "    CodeAgent,\n",
    "    ToolCallingAgent,\n",
    "    InferenceClientModel,\n",
    "    ManagedAgent,\n",
    "    DuckDuckGoSearchTool\n",
    ")\n",
    "\n",
    "model = InferenceClientModel(model_id)\n",
    "\n",
    "web_agent = ToolCallingAgent(\n",
    "    tools=[DuckDuckGoSearchTool(), visit_webpage],\n",
    "    model=model,\n",
    "    max_iterations=10,\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We then wrap this agent into a `ManagedAgent` that will make it callable by its manager agent."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "managed_web_agent = ManagedAgent(\n",
    "    agent=web_agent,\n",
    "    name=\"search_agent\",\n",
    "    description=\"Runs web searches for you. Give it your query as an argument.\",\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally we create a manager agent, and upon initialization we pass our managed agent to it in its `managed_agents` argument.\n",
    "\n",
    "Since this agent is the one tasked with the planning and thinking, advanced reasoning will be beneficial, so a `ReactCodeAgent` will be the best choice.\n",
    "\n",
    "Also, we want to ask a question that involves the current year: so let us add `additional_authorized_imports=[\"time\", \"datetime\"]`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "manager_agent = CodeAgent(\n",
    "    tools=[],\n",
    "    model=model,\n",
    "    managed_agents=[managed_web_agent],\n",
    "    additional_authorized_imports=[\"time\", \"datetime\"],\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That's all! Now let's run our system! We select a question that requires some calculation and "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702\">╭──────────────────────────────────────────────────── </span><span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">New run</span><span style=\"color: #d4b702; text-decoration-color: #d4b702\"> ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>                                                                                                                 <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">How many years ago was Stripe founded?</span>                                                                          <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>                                                                                                                 <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">╰─ InferenceClientModel - Qwen/Qwen2.5-72B-Instruct ────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;212;183;2m╭─\u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[1;38;2;212;183;2mNew run\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╮\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m                                                                                                                 \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mHow many years ago was Stripe founded?\u001b[0m                                                                          \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m                                                                                                                 \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m╰─\u001b[0m\u001b[38;2;212;183;2m InferenceClientModel - Qwen/Qwen2.5-72B-Instruct \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702\">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ </span><span style=\"font-weight: bold\">Step </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span><span style=\"color: #d4b702; text-decoration-color: #d4b702\"> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m0\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─ <span style=\"font-weight: bold\">Executing this code:</span> ──────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">1 </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">found_year </span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">=</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\"> search_agent(request</span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">=</span><span style=\"color: #e6db74; text-decoration-color: #e6db74; background-color: #272822\">\"When was Stripe founded?\"</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">)</span><span style=\"background-color: #272822\">                                              </span> │\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">2 </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">print(found_year)</span><span style=\"background-color: #272822\">                                                                                          </span> │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─ \u001b[1mExecuting this code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m1 \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mfound_year\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34msearch_agent\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mrequest\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mWhen was Stripe founded?\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m                                              \u001b[0m │\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m2 \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mprint\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mfound_year\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m                                                                                          \u001b[0m │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702\">╭──────────────────────────────────────────────────── </span><span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">New run</span><span style=\"color: #d4b702; text-decoration-color: #d4b702\"> ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>                                                                                                                 <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">You're a helpful agent named 'search_agent'.</span>                                                                    <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">You have been submitted this task by your manager.</span>                                                              <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">---</span>                                                                                                             <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">Task:</span>                                                                                                           <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">When was Stripe founded?</span>                                                                                        <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">---</span>                                                                                                             <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">You're helping your manager solve a wider task: so make sure to not provide a one-line answer, but give as much</span> <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">information as possible to give them a clear understanding of the answer.</span>                                       <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>                                                                                                                 <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">Your final_answer WILL HAVE to contain these parts:</span>                                                             <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">### 1. Task outcome (short version):</span>                                                                            <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">### 2. Task outcome (extremely detailed version):</span>                                                               <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">### 3. Additional context (if relevant):</span>                                                                        <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>                                                                                                                 <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">Put all these in your final_answer tool, everything that you do not pass as an argument to final_answer will be</span> <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">lost.</span>                                                                                                           <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">And even if your task resolution is not successful, please return as much context as possible, so that your </span>    <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">manager can act upon this feedback.</span>                                                                             <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span> <span style=\"font-weight: bold\">{additional_prompting}</span>                                                                                          <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>                                                                                                                 <span style=\"color: #d4b702; text-decoration-color: #d4b702\">│</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702\">╰─ InferenceClientModel - Qwen/Qwen2.5-72B-Instruct ────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;212;183;2m╭─\u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[1;38;2;212;183;2mNew run\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╮\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m                                                                                                                 \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mYou're a helpful agent named 'search_agent'.\u001b[0m                                                                    \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mYou have been submitted this task by your manager.\u001b[0m                                                              \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m---\u001b[0m                                                                                                             \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mTask:\u001b[0m                                                                                                           \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mWhen was Stripe founded?\u001b[0m                                                                                        \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m---\u001b[0m                                                                                                             \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mYou're helping your manager solve a wider task: so make sure to not provide a one-line answer, but give as much\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1minformation as possible to give them a clear understanding of the answer.\u001b[0m                                       \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m                                                                                                                 \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mYour final_answer WILL HAVE to contain these parts:\u001b[0m                                                             \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m### 1. Task outcome (short version):\u001b[0m                                                                            \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m### 2. Task outcome (extremely detailed version):\u001b[0m                                                               \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m### 3. Additional context (if relevant):\u001b[0m                                                                        \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m                                                                                                                 \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mPut all these in your final_answer tool, everything that you do not pass as an argument to final_answer will be\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mlost.\u001b[0m                                                                                                           \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mAnd even if your task resolution is not successful, please return as much context as possible, so that your \u001b[0m    \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mmanager can act upon this feedback.\u001b[0m                                                                             \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m{additional_prompting}\u001b[0m                                                                                          \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m│\u001b[0m                                                                                                                 \u001b[38;2;212;183;2m│\u001b[0m\n",
       "\u001b[38;2;212;183;2m╰─\u001b[0m\u001b[38;2;212;183;2m InferenceClientModel - Qwen/Qwen2.5-72B-Instruct \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702\">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ </span><span style=\"font-weight: bold\">Step </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span><span style=\"color: #d4b702; text-decoration-color: #d4b702\"> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m0\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ Calling tool: 'web_search' with arguments: {'query': 'When was Stripe founded'}                                 │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ Calling tool: 'web_search' with arguments: {'query': 'When was Stripe founded'}                                 │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Observations: ## Search Results\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>Stripe, Inc. - Wikipedia<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://en.wikipedia.org/wiki/Stripe,_Inc.)</span>\n",
       "Stripe, Inc. is an Irish-American <span style=\"font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span><span style=\"font-weight: bold\">]</span> multinational financial services and software as a service <span style=\"font-weight: bold\">(</span>SaaS<span style=\"font-weight: bold\">)</span> <span style=\"color: #808000; text-decoration-color: #808000\">...</span> Irish \n",
       "entrepreneur brothers John and Patrick Collison founded Stripe in Palo Alto, California, in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2010</span>, <span style=\"font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">9</span><span style=\"font-weight: bold\">]</span> and serve as \n",
       "the company's president <span style=\"font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">10</span><span style=\"font-weight: bold\">]</span> and CEO, <span style=\"font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">11</span><span style=\"font-weight: bold\">]</span> respectively.\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>The Collison Brothers and Story Behind The Founding Of \n",
       "Stripe<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://www.startupgrind.com/blog/the-collison-brothers-and-story-behind-the-founding-of-stripe/)</span>\n",
       "Stripe is a payment platform that aims to give developers the tools they need to create the most secure and novel \n",
       "buying experiences. The company was founded in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2010</span> by brothers Patrick and John Collison, who started working on \n",
       "it while they were still in high school and college.\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>Stripe's Founders: The Story of Collison Brothers - \n",
       "KITRUM<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://kitrum.com/blog/stripe-founders-the-story-of-collison-brothers/)</span>\n",
       "The factors contributing to Stripe's rise in popularity. Back in May <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2011</span>, Stripe acquired a $<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span> million investment \n",
       "from a group of venture capitalists, including Peter Thiel, Elon Musk, Sequoia Capital, SV Angel, and Andreessen \n",
       "Horowitz. Stripe then launched publicly in September <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2011</span> after a lengthy private beta period.\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>Stripe, Inc. - Simple English Wikipedia, the free encyclopedia<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://simple.wikipedia.org/wiki/Stripe,_Inc.)</span>\n",
       "Stripe, Inc. is an Irish-American financial services and software as a service <span style=\"font-weight: bold\">(</span>SaaS<span style=\"font-weight: bold\">)</span> company. It is headquartered \n",
       "in South San Francisco, California, United States and Dublin, Ireland. <span style=\"font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"font-weight: bold\">]</span> <span style=\"font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span><span style=\"font-weight: bold\">]</span> The company offers payment software \n",
       "for e-commerce websites and mobile applications. Stripe was founded in Palo Alto, California in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2009</span>.\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>Stripe | Company Overview &amp; News - Forbes<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://www.forbes.com/companies/stripe/)</span>\n",
       "More than $<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> trillion in payments now pass through Stripe's software on behalf of customers, a milestone reached \n",
       "just over <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">12</span> years after its first product launch in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2011</span>. <span style=\"color: #808000; text-decoration-color: #808000\">...</span> Founded <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2009</span> <span style=\"color: #808000; text-decoration-color: #808000\">...</span>\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>Building a $<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">95</span> Billion Startup: The Stripe Story - Wishpond \n",
       "Blog<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://blog.wishpond.com/post/115675438299/stripe-startup)</span>\n",
       "Stripe Background: How Stripe Was Started. Stripe was founded <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">11</span> years ago by John and Patrick Collison, aged <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">19</span> \n",
       "and <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">21</span> at the time. Hailing from Dromineer, a small town on the shores of Lough Derg in County Tipperary, Ireland, \n",
       "both the brothers were academically gifted and showed a special interest in math and physics from a very young age.\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>Stripe History: Founding, Timeline, and Milestones - Zippia<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://www.zippia.com/stripe-careers-39818/history/)</span>\n",
       "Stripe was founded in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2010</span> by Irish entrepreneurs Patrick and John Collison. John and Patrick first started working\n",
       "on Stripe in early <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2010</span>. In early <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2010</span> John and Patrick began working on Stripe together. In <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2010</span> he co-founded \n",
       "Commonred which was acquired by Income.com.\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>The Collison Brothers: The Story Behind The Founding Of \n",
       "Stripe<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://medium.com/startup-grind/the-collison-brothers-the-story-behind-the-founding-of-stripe-ae013434c080</span>\n",
       "<span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">)</span>\n",
       "In <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2012</span>, we updated this piece to reflect Bloomberg's latest report that Stripe had just raised an $18MM round with\n",
       "Sequoia at a $100MM valuation. On July 28th, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2015</span> Stripe announced even bigger…\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>Stripe co-founder and CEO Patrick Collison on \"prizing the small \n",
       "<span style=\"color: #808000; text-decoration-color: #808000\">...</span><span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://newsroom.haas.berkeley.edu/stripe-co-founder-and-ceo-patrick-collison-on-founding-a-company-that-shoul</span>\n",
       "<span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">d-have-already-existed/)</span>\n",
       "Stripe was born when Patrick and John looked for a payment platform but couldn't find all of the features they \n",
       "thought would be important. And Stripe debuted in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2010</span> and grew exponentially because the product is really simple \n",
       "for businesses to implement. Of course, the back end is anything but simple, but it's easy on the front end for <span style=\"color: #808000; text-decoration-color: #808000\">...</span>\n",
       "\n",
       "<span style=\"font-weight: bold\">[</span>What is Stripe and why is the State investing $<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">50</span> million in \n",
       "it?<span style=\"font-weight: bold\">](</span><span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://www.irishtimes.com/business/technology/what-is-stripe-and-why-is-the-state-investing-50-million-in-it-</span>\n",
       "<span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">1.4510680)</span>\n",
       "They founded Stripe two years later, which became a tech unicorn - that is a privately-owned company worth more \n",
       "than $<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> billion in <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2014</span>. John was named the world's youngest self-made <span style=\"color: #808000; text-decoration-color: #808000\">...</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "Observations: ## Search Results\n",
       "\n",
       "\u001b[1m[\u001b[0mStripe, Inc. - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/Stripe,_Inc.\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "Stripe, Inc. is an Irish-American \u001b[1m[\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1m]\u001b[0m multinational financial services and software as a service \u001b[1m(\u001b[0mSaaS\u001b[1m)\u001b[0m \u001b[33m...\u001b[0m Irish \n",
       "entrepreneur brothers John and Patrick Collison founded Stripe in Palo Alto, California, in \u001b[1;36m2010\u001b[0m, \u001b[1m[\u001b[0m\u001b[1;36m9\u001b[0m\u001b[1m]\u001b[0m and serve as \n",
       "the company's president \u001b[1m[\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1m]\u001b[0m and CEO, \u001b[1m[\u001b[0m\u001b[1;36m11\u001b[0m\u001b[1m]\u001b[0m respectively.\n",
       "\n",
       "\u001b[1m[\u001b[0mThe Collison Brothers and Story Behind The Founding Of \n",
       "Stripe\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.startupgrind.com/blog/the-collison-brothers-and-story-behind-the-founding-of-stripe/\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "Stripe is a payment platform that aims to give developers the tools they need to create the most secure and novel \n",
       "buying experiences. The company was founded in \u001b[1;36m2010\u001b[0m by brothers Patrick and John Collison, who started working on \n",
       "it while they were still in high school and college.\n",
       "\n",
       "\u001b[1m[\u001b[0mStripe's Founders: The Story of Collison Brothers - \n",
       "KITRUM\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://kitrum.com/blog/stripe-founders-the-story-of-collison-brothers/\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "The factors contributing to Stripe's rise in popularity. Back in May \u001b[1;36m2011\u001b[0m, Stripe acquired a $\u001b[1;36m2\u001b[0m million investment \n",
       "from a group of venture capitalists, including Peter Thiel, Elon Musk, Sequoia Capital, SV Angel, and Andreessen \n",
       "Horowitz. Stripe then launched publicly in September \u001b[1;36m2011\u001b[0m after a lengthy private beta period.\n",
       "\n",
       "\u001b[1m[\u001b[0mStripe, Inc. - Simple English Wikipedia, the free encyclopedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://simple.wikipedia.org/wiki/Stripe,_Inc.\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "Stripe, Inc. is an Irish-American financial services and software as a service \u001b[1m(\u001b[0mSaaS\u001b[1m)\u001b[0m company. It is headquartered \n",
       "in South San Francisco, California, United States and Dublin, Ireland. \u001b[1m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m]\u001b[0m \u001b[1m[\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1m]\u001b[0m The company offers payment software \n",
       "for e-commerce websites and mobile applications. Stripe was founded in Palo Alto, California in \u001b[1;36m2009\u001b[0m.\n",
       "\n",
       "\u001b[1m[\u001b[0mStripe | Company Overview & News - Forbes\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.forbes.com/companies/stripe/\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "More than $\u001b[1;36m1\u001b[0m trillion in payments now pass through Stripe's software on behalf of customers, a milestone reached \n",
       "just over \u001b[1;36m12\u001b[0m years after its first product launch in \u001b[1;36m2011\u001b[0m. \u001b[33m...\u001b[0m Founded \u001b[1;36m2009\u001b[0m \u001b[33m...\u001b[0m\n",
       "\n",
       "\u001b[1m[\u001b[0mBuilding a $\u001b[1;36m95\u001b[0m Billion Startup: The Stripe Story - Wishpond \n",
       "Blog\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://blog.wishpond.com/post/115675438299/stripe-startup\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "Stripe Background: How Stripe Was Started. Stripe was founded \u001b[1;36m11\u001b[0m years ago by John and Patrick Collison, aged \u001b[1;36m19\u001b[0m \n",
       "and \u001b[1;36m21\u001b[0m at the time. Hailing from Dromineer, a small town on the shores of Lough Derg in County Tipperary, Ireland, \n",
       "both the brothers were academically gifted and showed a special interest in math and physics from a very young age.\n",
       "\n",
       "\u001b[1m[\u001b[0mStripe History: Founding, Timeline, and Milestones - Zippia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.zippia.com/stripe-careers-39818/history/\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "Stripe was founded in \u001b[1;36m2010\u001b[0m by Irish entrepreneurs Patrick and John Collison. John and Patrick first started working\n",
       "on Stripe in early \u001b[1;36m2010\u001b[0m. In early \u001b[1;36m2010\u001b[0m John and Patrick began working on Stripe together. In \u001b[1;36m2010\u001b[0m he co-founded \n",
       "Commonred which was acquired by Income.com.\n",
       "\n",
       "\u001b[1m[\u001b[0mThe Collison Brothers: The Story Behind The Founding Of \n",
       "Stripe\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://medium.com/startup-grind/the-collison-brothers-the-story-behind-the-founding-of-stripe-ae013434c080\u001b[0m\n",
       "\u001b[4;94m)\u001b[0m\n",
       "In \u001b[1;36m2012\u001b[0m, we updated this piece to reflect Bloomberg's latest report that Stripe had just raised an $18MM round with\n",
       "Sequoia at a $100MM valuation. On July 28th, \u001b[1;36m2015\u001b[0m Stripe announced even bigger…\n",
       "\n",
       "\u001b[1m[\u001b[0mStripe co-founder and CEO Patrick Collison on \"prizing the small \n",
       "\u001b[33m...\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://newsroom.haas.berkeley.edu/stripe-co-founder-and-ceo-patrick-collison-on-founding-a-company-that-shoul\u001b[0m\n",
       "\u001b[4;94md-have-already-existed/\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "Stripe was born when Patrick and John looked for a payment platform but couldn't find all of the features they \n",
       "thought would be important. And Stripe debuted in \u001b[1;36m2010\u001b[0m and grew exponentially because the product is really simple \n",
       "for businesses to implement. Of course, the back end is anything but simple, but it's easy on the front end for \u001b[33m...\u001b[0m\n",
       "\n",
       "\u001b[1m[\u001b[0mWhat is Stripe and why is the State investing $\u001b[1;36m50\u001b[0m million in \n",
       "it?\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.irishtimes.com/business/technology/what-is-stripe-and-why-is-the-state-investing-50-million-in-it-\u001b[0m\n",
       "\u001b[4;94m1.4510680\u001b[0m\u001b[4;94m)\u001b[0m\n",
       "They founded Stripe two years later, which became a tech unicorn - that is a privately-owned company worth more \n",
       "than $\u001b[1;36m1\u001b[0m billion in \u001b[1;36m2014\u001b[0m. John was named the world's youngest self-made \u001b[33m...\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">[Step 0: Duration 3.77 seconds| Input tokens: 1,599 | Output tokens: 20]</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2m[Step 0: Duration 3.77 seconds| Input tokens: 1,599 | Output tokens: 20]\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702\">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ </span><span style=\"font-weight: bold\">Step </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"color: #d4b702; text-decoration-color: #d4b702\"> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m1\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ Calling tool: 'final_answer' with arguments: {'answer': '### 1. Task outcome (short version):\\\\\\\\\\\\\\\\nStripe    │\n",
       "│ was founded in 2010.\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\n### 2. Task outcome (extremely detailed version):\\\\\\\\\\\\\\\\nStripe, Inc.    │\n",
       "│ was founded in 2010 by Irish brothers John and Patrick Collison. The company, which offers payment software for │\n",
       "│ e-commerce websites and mobile applications, was initially established in Palo Alto, California. John and       │\n",
       "│ Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe in early 2010. The     │\n",
       "│ company publicly launched in September 2011 after a lengthy private beta period.\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\n### 3.        │\n",
       "│ Additional context (if relevant):\\\\\\\\\\\\\\\\n- The Collison brothers secured a $2 million investment from notable  │\n",
       "│ investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\\\\\\\\\\\\\n- Stripe has     │\n",
       "│ since grown significantly, processing over $1 trillion in payments through its software, contributing to its    │\n",
       "│ rapid rise in popularity. The company has become a leading player in the financial technology sector, with a    │\n",
       "│ valuation that has surpassed $95 billion.'}                                                                     │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ Calling tool: 'final_answer' with arguments: {'answer': '### 1. Task outcome (short version):\\\\\\\\\\\\\\\\nStripe    │\n",
       "│ was founded in 2010.\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\n### 2. Task outcome (extremely detailed version):\\\\\\\\\\\\\\\\nStripe, Inc.    │\n",
       "│ was founded in 2010 by Irish brothers John and Patrick Collison. The company, which offers payment software for │\n",
       "│ e-commerce websites and mobile applications, was initially established in Palo Alto, California. John and       │\n",
       "│ Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe in early 2010. The     │\n",
       "│ company publicly launched in September 2011 after a lengthy private beta period.\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\n### 3.        │\n",
       "│ Additional context (if relevant):\\\\\\\\\\\\\\\\n- The Collison brothers secured a $2 million investment from notable  │\n",
       "│ investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\\\\\\\\\\\\\n- Stripe has     │\n",
       "│ since grown significantly, processing over $1 trillion in payments through its software, contributing to its    │\n",
       "│ rapid rise in popularity. The company has become a leading player in the financial technology sector, with a    │\n",
       "│ valuation that has surpassed $95 billion.'}                                                                     │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">Final answer: ### 1. Task outcome (short version):\\\\\\\\nStripe was founded in 2010.\\\\\\\\n\\\\\\\\n### 2. Task outcome </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">(extremely detailed version):\\\\\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The</span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">company, which offers payment software for e-commerce websites and mobile applications, was initially established </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">in Palo Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">on Stripe in early 2010. The company publicly launched in September 2011 after a lengthy private beta </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">period.\\\\\\\\n\\\\\\\\n### 3. Additional context (if relevant):\\\\\\\\n- The Collison brothers secured a $2 million </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">investment from notable investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">2011.\\\\\\\\n- Stripe has since grown significantly, processing over $1 trillion in payments through its software, </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">contributing to its rapid rise in popularity. The company has become a leading player in the financial technology </span>\n",
       "<span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">sector, with a valuation that has surpassed $95 billion.</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;38;2;212;183;2mFinal answer: ### 1. Task outcome (short version):\\\\\\\\nStripe was founded in 2010.\\\\\\\\n\\\\\\\\n### 2. Task outcome \u001b[0m\n",
       "\u001b[1;38;2;212;183;2m(extremely detailed version):\\\\\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The\u001b[0m\n",
       "\u001b[1;38;2;212;183;2mcompany, which offers payment software for e-commerce websites and mobile applications, was initially established \u001b[0m\n",
       "\u001b[1;38;2;212;183;2min Palo Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working \u001b[0m\n",
       "\u001b[1;38;2;212;183;2mon Stripe in early 2010. The company publicly launched in September 2011 after a lengthy private beta \u001b[0m\n",
       "\u001b[1;38;2;212;183;2mperiod.\\\\\\\\n\\\\\\\\n### 3. Additional context (if relevant):\\\\\\\\n- The Collison brothers secured a $2 million \u001b[0m\n",
       "\u001b[1;38;2;212;183;2minvestment from notable investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May \u001b[0m\n",
       "\u001b[1;38;2;212;183;2m2011.\\\\\\\\n- Stripe has since grown significantly, processing over $1 trillion in payments through its software, \u001b[0m\n",
       "\u001b[1;38;2;212;183;2mcontributing to its rapid rise in popularity. The company has become a leading player in the financial technology \u001b[0m\n",
       "\u001b[1;38;2;212;183;2msector, with a valuation that has surpassed $95 billion.\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">[Step 1: Duration 34.02 seconds| Input tokens: 4,290 | Output tokens: 288]</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2m[Step 1: Duration 34.02 seconds| Input tokens: 4,290 | Output tokens: 288]\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Execution logs:</span>\n",
       "### 1. Task outcome (short version):\\\\\\\\nStripe was founded in 2010.\\\\\\\\n\\\\\\\\n### 2. Task outcome (extremely \n",
       "detailed version):\\\\\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The company, \n",
       "which offers payment software for e-commerce websites and mobile applications, was initially established in Palo \n",
       "Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe\n",
       "in early 2010. The company publicly launched in September 2011 after a lengthy private beta period.\\\\\\\\n\\\\\\\\n### 3.\n",
       "Additional context (if relevant):\\\\\\\\n- The Collison brothers secured a $2 million investment from notable \n",
       "investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\\\\\n- Stripe has since grown\n",
       "significantly, processing over $1 trillion in payments through its software, contributing to its rapid rise in \n",
       "popularity. The company has become a leading player in the financial technology sector, with a valuation that has \n",
       "surpassed $95 billion.\n",
       "\n",
       "Out: None\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1mExecution logs:\u001b[0m\n",
       "### 1. Task outcome (short version):\\\\\\\\nStripe was founded in 2010.\\\\\\\\n\\\\\\\\n### 2. Task outcome (extremely \n",
       "detailed version):\\\\\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The company, \n",
       "which offers payment software for e-commerce websites and mobile applications, was initially established in Palo \n",
       "Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe\n",
       "in early 2010. The company publicly launched in September 2011 after a lengthy private beta period.\\\\\\\\n\\\\\\\\n### 3.\n",
       "Additional context (if relevant):\\\\\\\\n- The Collison brothers secured a $2 million investment from notable \n",
       "investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\\\\\n- Stripe has since grown\n",
       "significantly, processing over $1 trillion in payments through its software, contributing to its rapid rise in \n",
       "popularity. The company has become a leading player in the financial technology sector, with a valuation that has \n",
       "surpassed $95 billion.\n",
       "\n",
       "Out: None\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">[Step 0: Duration 45.47 seconds| Input tokens: 2,691 | Output tokens: 268]</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2m[Step 0: Duration 45.47 seconds| Input tokens: 2,691 | Output tokens: 268]\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702\">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ </span><span style=\"font-weight: bold\">Step </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"color: #d4b702; text-decoration-color: #d4b702\"> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m1\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─ <span style=\"font-weight: bold\">Executing this code:</span> ──────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">1 </span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">import</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\"> datetime</span><span style=\"background-color: #272822\">                                                                                            </span> │\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">2 </span><span style=\"background-color: #272822\">                                                                                                           </span> │\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">3 </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">founding_year </span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">=</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\"> </span><span style=\"color: #ae81ff; text-decoration-color: #ae81ff; background-color: #272822\">2010</span><span style=\"background-color: #272822\">                                                                                       </span> │\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">4 </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">current_year </span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">=</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\"> datetime</span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">.</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">datetime</span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">.</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">now()</span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">.</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">year</span><span style=\"background-color: #272822\">                                                                </span> │\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">5 </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">years_since_founded </span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">=</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\"> current_year </span><span style=\"color: #ff4689; text-decoration-color: #ff4689; background-color: #272822\">-</span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\"> founding_year</span><span style=\"background-color: #272822\">                                                         </span> │\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">6 </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">print(years_since_founded)</span><span style=\"background-color: #272822\">                                                                                 </span> │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─ \u001b[1mExecuting this code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m1 \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34mimport\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mdatetime\u001b[0m\u001b[48;2;39;40;34m                                                                                            \u001b[0m │\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m2 \u001b[0m\u001b[48;2;39;40;34m                                                                                                           \u001b[0m │\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m3 \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mfounding_year\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;174;129;255;48;2;39;40;34m2010\u001b[0m\u001b[48;2;39;40;34m                                                                                       \u001b[0m │\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m4 \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mcurrent_year\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mdatetime\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m.\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mdatetime\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m.\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mnow\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m.\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34myear\u001b[0m\u001b[48;2;39;40;34m                                                                \u001b[0m │\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m5 \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34myears_since_founded\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mcurrent_year\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m-\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mfounding_year\u001b[0m\u001b[48;2;39;40;34m                                                         \u001b[0m │\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m6 \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mprint\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34myears_since_founded\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m                                                                                 \u001b[0m │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Execution logs:</span>\n",
       "15\n",
       "\n",
       "Out: None\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1mExecution logs:\u001b[0m\n",
       "15\n",
       "\n",
       "Out: None\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">[Step 1: Duration 7.91 seconds| Input tokens: 5,155 | Output tokens: 350]</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2m[Step 1: Duration 7.91 seconds| Input tokens: 5,155 | Output tokens: 350]\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702\">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ </span><span style=\"font-weight: bold\">Step </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span><span style=\"color: #d4b702; text-decoration-color: #d4b702\"> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m2\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─ <span style=\"font-weight: bold\">Executing this code:</span> ──────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ <span style=\"color: #e3e3dd; text-decoration-color: #e3e3dd; background-color: #272822; font-weight: bold\">  </span><span style=\"color: #656660; text-decoration-color: #656660; background-color: #272822\">1 </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">final_answer(years_since_founded)</span><span style=\"background-color: #272822\">                                                                          </span> │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─ \u001b[1mExecuting this code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ \u001b[1;38;2;227;227;221;48;2;39;40;34m  \u001b[0m\u001b[38;2;101;102;96;48;2;39;40;34m1 \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mfinal_answer\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34myears_since_founded\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m                                                                          \u001b[0m │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d4b702; text-decoration-color: #d4b702; font-weight: bold\">Out - Final answer: 15</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;38;2;212;183;2mOut - Final answer: 15\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">[Step 2: Duration 5.18 seconds| Input tokens: 7,808 | Output tokens: 406]</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2m[Step 2: Duration 5.18 seconds| Input tokens: 7,808 | Output tokens: 406]\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "15"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "manager_agent.run(\"How many years ago was Stripe founded?\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Our agents managed to efficiently collaborate towards solving the task! ✅\n",
    "\n",
    "💡 You can easily extend this to more agents: one does the code execution, one the web search, one handles file loadings...\n",
    "\n",
    "🤔💭 One could even think of doing more complex, tree-like hierarchies, with one CEO agent handling multiple middle managers, each with several reports.\n",
    "\n",
    "We could even add more intermediate layers of management, each with multiple daily meetings, lots of agile stuff with scrum masters, and each new component adds enough friction to ensure the tasks never get done... Ehm wait, no, let's stick with our simple structure."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "test2",
   "language": "python",
   "name": "test2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
